/**
 * @AUTHOR 林亚军
 * @date  2013-09-24
 * @description tabs
 **/
(function($,undefined){
	$.widget("ui.simpleTabs",$.ui.tabs,{
		version:"0.0.1",
		options: {
			tabIds:[]
		},
		_create:function(){
			var el=this.element,_tabIds=this.options.tabIds;
			if(_tabIds instanceof Array){
				for(var i=0;i<_tabIds.length;i++){
					if(_tabIds[i].showClose){
						if(typeof(_tabIds[i].href)=="string"){
							el.children("ul").append("<li><a href=\""+_tabIds[i].href+"\">"+_tabIds[i].title+"</a><span class=\"ui-icon ui-icon-close\" role=\"presentation\"></span></li>");
							continue;
						}
						el.children("ul").append("<li><a href=\"#"+_tabIds[i].renderTo+"\">"+_tabIds[i].title+"</a><span class=\"ui-icon ui-icon-close\" role=\"presentation\"></span></li>");
						continue;
					}
					if(typeof(_tabIds[i].href)=="string"){
							el.children("ul").append("<li><a href=\""+_tabIds[i].href+"\">"+_tabIds[i].title+"</a></li>");
							continue;
					}
					el.children("ul").append("<li><a href=\"#"+_tabIds[i].renderTo+"\">"+_tabIds[i].title+"</a></li>");
				}
				
			}
			$.ui.tabs.prototype._create.apply( this );
		}
	});
})(jQuery);